<?php
/*-----------------------------------------------------------------
* 	ID:						cseov25_qf13.php
* 	Letzter Stand:			v2.5
* 	zuletzt geaendert von:	akausch
* 	Datum:					2014/04/08
*
* 	Copyright (c) since 2010 commerce:SEO by Webdesign Erfurt
* 	http://www.commerce-seo.de
* ---------------------------------------------------------------*/

class cseov25_qf13 {
var $title, $output;

function cseov25_qf13() {
  $this->code = 'cseov25_qf13';
  $this->version = '2.5.13';
  $this->title = 'cseov25_qf13';
  $this->description = 'Fix5.12 für commerce:seo v2next 2.5.12';
  $this->enabled = ((MODULE_CSEO_V251QF13_STATUS == 'true') ? true : false);
  $this->sort_order = MODULE_CSEO_V251QF13_SORT_ORDER;

  $this->output = array();
}

function process() {
  global $order, $xtPrice;
}

function check() {
  if (!isset($this->_check)) {
	$check_query = xtc_db_query("SELECT configuration_value FROM " . TABLE_CONFIGURATION . " WHERE configuration_key = 'MODULE_CSEO_V251QF13_STATUS'");
	$this->_check = xtc_db_num_rows($check_query);
  }
  return $this->_check;
}

function keys() {
	return array('MODULE_CSEO_V251QF13_STATUS', 'MODULE_CSEO_V251QF13_SORT_ORDER');
}

function install() {
	xtc_db_query("INSERT INTO " . TABLE_CONFIGURATION . " (configuration_key, configuration_value,configuration_group_id, sort_order, set_function, date_added) VALUES ('MODULE_CSEO_V251QF13_STATUS', 'true', '6', '1','', now())");
	xtc_db_query("INSERT INTO " . TABLE_CONFIGURATION . " (configuration_key, configuration_value,configuration_group_id, sort_order, date_added) VALUES ('MODULE_CSEO_V251QF13_SORT_ORDER', '1','6', '2', now())");
	xtc_db_query("INSERT INTO " . TABLE_CONFIGURATION . " (configuration_key, configuration_value,configuration_group_id, sort_order, date_added) VALUES ('MODULE_CSEO_V251QF13', 'true','6', '3', now())");
	
	//Google Condition
	xtc_db_query("ALTER TABLE products CHANGE products_zustand products_zustand VARCHAR(10) NOT NULL DEFAULT 'new';");
	xtc_db_query("UPDATE products SET products_zustand = 'new' WHERE products_zustand = 'neu';");
	xtc_db_query("UPDATE products SET products_zustand = 'used' WHERE products_zustand = 'gebraucht';");
	xtc_db_query("UPDATE products SET products_zustand = 'refurbished' WHERE products_zustand = 'erneuert';");
	
	//SEO Config
	$check_query = xtc_db_query("SELECT cseo_key FROM cseo_configuration  WHERE cseo_key = 'SEOLYZEEMAIL';");
	if (xtc_db_num_rows($check_query) == 0) {
		xtc_db_query("INSERT INTO cseo_configuration (cseo_key, cseo_group_id, cseo_sort_order) VALUES ('SEOLYZEEMAIL', 2, 1);");
		xtc_db_query("INSERT INTO cseo_configuration (cseo_key, cseo_group_id, cseo_sort_order) VALUES ('SEOLYZEVORNAME', 2, 2);");
		xtc_db_query("INSERT INTO cseo_configuration (cseo_key, cseo_group_id, cseo_sort_order) VALUES ('SEOLYZENACHNAME', 2, 3);");
		xtc_db_query("INSERT INTO cseo_configuration (cseo_key, cseo_group_id, cseo_sort_order) VALUES ('SEOLYZETELE', 2, 4);");
		xtc_db_query("INSERT INTO cseo_configuration (cseo_key, cseo_group_id, cseo_sort_order) VALUES ('SEOLYZEAPIKEY', 2, 5);");
	}	
	//Admin
	if (!column_exists ('admin_access','cseo_seolyze')) {
		@xtc_db_query("ALTER TABLE admin_access ADD COLUMN cseo_seolyze INT(1) NOT NULL DEFAULT '0';");
		@xtc_db_query("UPDATE admin_access SET cseo_seolyze = 1;");
	}

	//Fehlende Navi
	$check_query = xtc_db_query("SELECT name FROM admin_navigation WHERE name = 'cseo_seolyze';");
	if (xtc_db_num_rows($check_query) == 0) {
		$lang_other = xtc_db_query("SELECT languages_id FROM languages;");
		if (xtc_db_num_rows($lang_other) > 0) {
			while ($other_lang = xtc_db_fetch_array($lang_other)) {
				$language_id = $other_lang['languages_id'];
				xtc_db_query("INSERT INTO admin_navigation VALUES (NULL, 'cseo_seolyze', 'SEOLYZE', 'seo_tools', 'cseo_seolyze.php', NULL, ".$language_id.", NULL, 1);");
			}
		}
	}
	//2.5.13
	$check_query = xtc_db_query("SELECT configuration_key FROM " . TABLE_CONFIGURATION . "  WHERE configuration_key = 'ATTRIBUTE_OPTION_AS_DEFAULT';");
	if (xtc_db_num_rows($check_query) == 0) {
		xtc_db_query("INSERT INTO configuration VALUES (NULL, 'ATTRIBUTE_OPTION_AS_DEFAULT', 'false', 17, 13, NULL, NOW(), NULL, \"xtc_cfg_select_option(array('true', 'false'),\");");
	}
	
	$check_query = xtc_db_query("SELECT box_name FROM boxes WHERE box_name = 'calender';");
	if (xtc_db_num_rows($check_query) == 0) {
		@xtc_db_query("INSERT INTO boxes (id, box_name, position, sort_id, status, box_type, file_flag, mobile) VALUES ('', 'calender', 'boxen', 30, 0, 'file', 0, 0);");
	}
	$check_query = xtc_db_query("SELECT box_name FROM boxes_names WHERE box_name = 'calender';");
	if (xtc_db_num_rows($check_query) == 0) {
		$lang_other = xtc_db_query("SELECT languages_id FROM languages;");
		if (xtc_db_num_rows($lang_other) > 0) {
			while ($other_lang = xtc_db_fetch_array($lang_other)) {
				$language_id = $other_lang['languages_id'];
				xtc_db_query("INSERT INTO boxes_names (id, box_name, box_title, box_desc, language_id, status) VALUES ('', 'calender', 'Events', '', ".$language_id.", 1);");
			}
		}
	}	
	
	
	//Fehlende Config
	//2.5.12
	//Admin
	if (!column_exists ('admin_access','mailbeez')) {
		@xtc_db_query("ALTER TABLE admin_access ADD COLUMN mailbeez INT(1) NOT NULL DEFAULT '0';");
		@xtc_db_query("UPDATE admin_access SET mailbeez = 1;");
	}
	if (!column_exists ('admin_access','protectedshops')) {
		@xtc_db_query("ALTER TABLE admin_access ADD COLUMN protectedshops INT(1) NOT NULL DEFAULT '0';");
		@xtc_db_query("UPDATE admin_access SET protectedshops = 1;");
	}
	//Fehlende Navi
	$check_query = xtc_db_query("SELECT name FROM admin_navigation WHERE name = 'protectedshops';");
	if (xtc_db_num_rows($check_query) == 0) {
		$lang_other = xtc_db_query("SELECT languages_id FROM languages;");
		if (xtc_db_num_rows($lang_other) > 0) {
			while ($other_lang = xtc_db_fetch_array($lang_other)) {
				$language_id = $other_lang['languages_id'];
				xtc_db_query("INSERT INTO admin_navigation VALUES (NULL, 'protectedshops', 'Protectedshops', 'modules', 'protectedshops.php', NULL, ".$language_id.", NULL, 5);");
			}
		}
	}
	$check_query = xtc_db_query("SELECT name FROM admin_navigation WHERE name = 'mailbeez';");
	if (xtc_db_num_rows($check_query) == 0) {
		$lang_other = xtc_db_query("SELECT languages_id FROM languages;");
		if (xtc_db_num_rows($lang_other) > 0) {
			while ($other_lang = xtc_db_fetch_array($lang_other)) {
				$language_id = $other_lang['languages_id'];
				xtc_db_query("INSERT INTO admin_navigation VALUES (NULL, 'mailbeez', 'Mailbeez', 'tools', 'mailbeez.php', NULL, ".$language_id.", NULL, 5);");
			}
		}
	}
	$check_query = xtc_db_query("SELECT configuration_key FROM " . TABLE_CONFIGURATION . "  WHERE configuration_key = 'MODULE_CSEO_MAILBEEZ_STATUS';");
	if (xtc_db_num_rows($check_query) == 0) {
		xtc_db_query("INSERT INTO configuration VALUES (NULL, 'MODULE_CSEO_MAILBEEZ_STATUS', 'true', 6, 1, NULL, '', NOW(), '');");
	}
	$check_query = xtc_db_query("SELECT configuration_key FROM " . TABLE_CONFIGURATION . "  WHERE configuration_key = 'MODULE_CSEO_MAILBEEZ_SORT_ORDER';");
	if (xtc_db_num_rows($check_query) == 0) {
		xtc_db_query("INSERT INTO configuration VALUES (NULL, 'MODULE_CSEO_MAILBEEZ_SORT_ORDER', '1', 6, 2, NULL, '', NOW(), '');");
	}
	$check_query = xtc_db_query("SELECT configuration_key FROM " . TABLE_CONFIGURATION . "  WHERE configuration_key = 'MODULE_CSEO_MAILBEEZ';");
	if (xtc_db_num_rows($check_query) == 0) {
		xtc_db_query("INSERT INTO configuration VALUES (NULL, 'MODULE_CSEO_MAILBEEZ', 'true', 6, 3, NULL, '', NOW(), '');");
	}
	//Scripte Head Body
	$check_query = xtc_db_query("SELECT configuration_key FROM " . TABLE_CONFIGURATION . "  WHERE configuration_key = 'SCRIPT_CODE_BEVOR_BODY';");
	if (xtc_db_num_rows($check_query) == 0) {
		xtc_db_query("INSERT INTO configuration VALUES (NULL, 'SCRIPT_CODE_BEVOR_BODY', '', 361, 6, NULL, '', NOW(), 'xtc_cfg_textarea(');");
	}
	$check_query = xtc_db_query("SELECT configuration_key FROM " . TABLE_CONFIGURATION . "  WHERE configuration_key = 'SCRIPT_CODE_AFTER_BODY';");
	if (xtc_db_num_rows($check_query) == 0) {
		xtc_db_query("INSERT INTO configuration VALUES (NULL, 'SCRIPT_CODE_AFTER_BODY', '', 361, 8, NULL, '', NOW(), 'xtc_cfg_textarea(');");
	}
	
	xtc_db_query("UPDATE configuration SET sort_order =  '8' WHERE configuration_key = 'TRACKING_PIWIK_ACTIVE';");
	xtc_db_query("UPDATE configuration SET sort_order =  '9' WHERE configuration_key = 'TRACKING_PIWIK_LOCAL_PATH';");
	xtc_db_query("UPDATE configuration SET sort_order =  '10' WHERE configuration_key = 'TRACKING_PIWIK_LOCAL_SSL_PATH';");
	xtc_db_query("UPDATE configuration SET sort_order =  '11' WHERE configuration_key = 'TRACKING_PIWIK_ID';");
	
	$check_query = xtc_db_query("SELECT configuration_key FROM " . TABLE_CONFIGURATION . "  WHERE configuration_key = 'META_DISPLAY_DATE';");
	if (xtc_db_num_rows($check_query) == 0) {
		xtc_db_query("INSERT INTO configuration VALUES (NULL, 'META_DISPLAY_DATE', 'true', 16, 26, NULL, NOW(), NULL, \"xtc_cfg_select_option(array('true', 'false'),\");");
	}
	$check_query = xtc_db_query("SELECT configuration_key FROM " . TABLE_CONFIGURATION . "  WHERE configuration_key = 'MOBILE_CONF_START_FOOTER';");
	if (xtc_db_num_rows($check_query) == 0) {
		xtc_db_query("INSERT INTO configuration VALUES (NULL, 'MOBILE_CONF_START_FOOTER', 'false', 1000, 51, NULL, NOW(), NULL, \"xtc_cfg_select_option(array('true', 'false'),\");");
	}
	$check_query = xtc_db_query("SELECT configuration_key FROM " . TABLE_CONFIGURATION . "  WHERE configuration_key = 'MOBILE_CONF_CATEGORY_FOOTER';");
	if (xtc_db_num_rows($check_query) == 0) {
		xtc_db_query("INSERT INTO configuration VALUES (NULL, 'MOBILE_CONF_CATEGORY_FOOTER', 'false', 1000, 52, NULL, NOW(), NULL, \"xtc_cfg_select_option(array('true', 'false'),\");");
	}
	$check_query = xtc_db_query("SELECT configuration_key FROM " . TABLE_CONFIGURATION . "  WHERE configuration_key = 'SECURTY_LOGGIN_LOGIN';");
	if (xtc_db_num_rows($check_query) == 0) {
		xtc_db_query("INSERT INTO configuration VALUES (NULL, 'SECURTY_LOGGIN_LOGIN', 'false', 363, 13, NULL, NOW(), NULL, \"xtc_cfg_select_option(array('true', 'false'),\");");
	}
	$check_query = xtc_db_query("SELECT configuration_key FROM " . TABLE_CONFIGURATION . "  WHERE configuration_key = 'PRODUCT_DETAILS_RELATED_RAND';");
	if (xtc_db_num_rows($check_query) == 0) {
		xtc_db_query("INSERT INTO configuration VALUES (NULL, 'PRODUCT_DETAILS_RELATED_RAND', '4', 1002, 26, NULL, '', NOW(), '');");
	}
	$check_query = xtc_db_query("SELECT configuration_key FROM " . TABLE_CONFIGURATION . "  WHERE configuration_key = 'MODULE_CUSTOMERS_PDF_INVOICE_PRINT_TEL';");
	if (xtc_db_num_rows($check_query) == 0) {
		xtc_db_query("INSERT INTO configuration VALUES (NULL, 'MODULE_CUSTOMERS_PDF_INVOICE_PRINT_TEL', 'false', 1, 36, NULL, NOW(), NULL, \"xtc_cfg_select_option(array('true', 'false'),\");");
	}
	$check_query = xtc_db_query("SELECT configuration_key FROM " . TABLE_CONFIGURATION . "  WHERE configuration_key = 'MODULE_CUSTOMERS_PDF_INVOICE_PRINT_COMMENT';");
	if (xtc_db_num_rows($check_query) == 0) {
		xtc_db_query("INSERT INTO configuration VALUES (NULL, 'MODULE_CUSTOMERS_PDF_INVOICE_PRINT_COMMENT', 'false', 1, 37, NULL, NOW(), NULL, \"xtc_cfg_select_option(array('true', 'false'),\");");
	}
	$check_query = xtc_db_query("SELECT configuration_key FROM " . TABLE_CONFIGURATION . "  WHERE configuration_key = 'STOCK_DISABLE_PRODUCT';");
	if (xtc_db_num_rows($check_query) == 0) {
		xtc_db_query("INSERT INTO configuration VALUES (NULL, 'STOCK_DISABLE_PRODUCT', 'false', 9, 8, NULL, NOW(), NULL, \"xtc_cfg_select_option(array('true', 'false'),\");");
	}
	@xtc_db_query("DROP TABLE IF EXISTS log_configuration;");
	xtc_db_query("
		CREATE TABLE log_configuration (
		  log_group_id int(11) NOT NULL,
		  log_level_id int(11) NOT NULL,
		  log_output_type_id int(11) NOT NULL,
		  log_output_id int(11) NOT NULL,
		  PRIMARY KEY (log_group_id,log_level_id,log_output_type_id,log_output_id)
		) ENGINE=MyISAM DEFAULT CHARSET=utf8;
	");
	@xtc_db_query("DROP TABLE IF EXISTS protectedshops;");
	xtc_db_query("
		CREATE TABLE protectedshops (
		ps_id int(11) NOT NULL AUTO_INCREMENT,
		document_name varchar(255) NOT NULL,
		document_date datetime NOT NULL,
		md5 varchar(32) NOT NULL,
		document_type varchar(32) NOT NULL,
		content mediumtext NOT NULL,
		PRIMARY KEY (ps_id),
		KEY document_name (document_name,document_date,document_type)
		) ENGINE=MyISAM  DEFAULT CHARSET=utf8;
	");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (1, 1, 1, 1);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (1, 1, 1, 2);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (1, 1, 1, 3);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (1, 1, 1, 4);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (1, 1, 1, 5);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (1, 1, 1, 8);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (1, 1, 2, 1);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (1, 1, 3, 1);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (1, 1, 3, 2);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (1, 1, 3, 3);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (1, 1, 3, 4);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (1, 1, 3, 5);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (1, 1, 3, 8);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (1, 1, 4, 1);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (1, 1, 4, 2);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (1, 1, 4, 3);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (1, 1, 4, 4);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (1, 1, 4, 5);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (1, 1, 4, 8);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (1, 2, 1, 1);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (1, 2, 1, 2);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (1, 2, 1, 3);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (1, 2, 1, 4);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (1, 2, 1, 5);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (1, 2, 1, 8);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (1, 2, 2, 1);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (1, 2, 3, 1);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (1, 2, 3, 2);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (1, 2, 3, 3);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (1, 2, 3, 4);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (1, 2, 3, 5);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (1, 2, 3, 8);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (1, 2, 4, 1);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (1, 2, 4, 2);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (1, 2, 4, 3);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (1, 2, 4, 4);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (1, 2, 4, 5);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (1, 2, 4, 8);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (1, 3, 1, 1);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (1, 3, 1, 2);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (1, 3, 1, 3);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (1, 3, 1, 4);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (1, 3, 3, 1);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (1, 3, 3, 2);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (1, 3, 3, 3);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (1, 3, 3, 4);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (1, 3, 4, 1);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (1, 3, 4, 2);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (1, 3, 4, 3);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (1, 3, 4, 4);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (2, 1, 1, 1);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (2, 1, 1, 2);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (2, 1, 1, 3);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (2, 1, 1, 4);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (2, 1, 1, 5);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (2, 1, 1, 6);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (2, 1, 1, 7);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (2, 1, 1, 8);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (2, 1, 3, 1);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (2, 1, 3, 2);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (2, 1, 3, 3);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (2, 1, 3, 4);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (2, 1, 3, 5);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (2, 1, 3, 6);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (2, 1, 3, 7);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (2, 1, 3, 8);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (2, 1, 4, 1);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (2, 1, 4, 2);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (2, 1, 4, 3);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (2, 1, 4, 4);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (2, 1, 4, 5);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (2, 1, 4, 6);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (2, 1, 4, 7);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (2, 1, 4, 8);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (2, 2, 1, 1);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (2, 2, 1, 2);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (2, 2, 1, 3);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (2, 2, 1, 4);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (2, 2, 1, 5);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (2, 2, 1, 6);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (2, 2, 1, 7);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (2, 2, 1, 8);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (2, 2, 3, 1);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (2, 2, 3, 2);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (2, 2, 3, 3);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (2, 2, 3, 4);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (2, 2, 3, 5);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (2, 2, 3, 6);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (2, 2, 3, 7);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (2, 2, 3, 8);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (2, 2, 4, 1);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (2, 2, 4, 2);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (2, 2, 4, 3);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (2, 2, 4, 4);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (2, 2, 4, 5);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (2, 2, 4, 6);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (2, 2, 4, 7);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (2, 2, 4, 8);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (2, 3, 1, 1);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (2, 3, 1, 2);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (2, 3, 1, 3);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (2, 3, 1, 4);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (2, 3, 3, 1);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (2, 3, 3, 2);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (2, 3, 3, 3);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (2, 3, 3, 4);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (2, 3, 4, 1);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (2, 3, 4, 2);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (2, 3, 4, 3);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (2, 3, 4, 4);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (3, 1, 1, 1);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (3, 1, 1, 2);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (3, 1, 1, 3);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (3, 1, 1, 4);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (3, 1, 1, 5);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (3, 1, 1, 6);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (3, 1, 1, 7);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (3, 1, 1, 8);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (3, 1, 2, 1);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (3, 1, 3, 1);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (3, 1, 3, 2);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (3, 1, 3, 3);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (3, 1, 3, 4);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (3, 1, 3, 5);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (3, 1, 3, 6);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (3, 1, 3, 7);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (3, 1, 3, 8);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (3, 1, 4, 1);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (3, 1, 4, 2);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (3, 1, 4, 3);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (3, 1, 4, 4);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (3, 1, 4, 5);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (3, 1, 4, 6);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (3, 1, 4, 7);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (3, 1, 4, 8);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (3, 2, 1, 1);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (3, 2, 1, 2);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (3, 2, 1, 3);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (3, 2, 1, 4);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (3, 2, 1, 5);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (3, 2, 1, 8);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (3, 2, 4, 1);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (3, 2, 4, 2);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (3, 2, 4, 3);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (3, 2, 4, 4);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (3, 2, 4, 5);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (3, 2, 4, 8);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (3, 3, 1, 1);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (3, 3, 1, 2);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (4, 1, 1, 1);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (4, 1, 1, 2);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (4, 1, 1, 3);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (4, 1, 1, 4);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (4, 1, 1, 5);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (4, 1, 1, 6);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (4, 1, 1, 7);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (4, 1, 1, 8);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (4, 1, 2, 1);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (4, 1, 3, 1);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (4, 1, 3, 2);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (4, 1, 3, 3);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (4, 1, 3, 4);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (4, 1, 3, 5);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (4, 1, 3, 6);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (4, 1, 3, 7);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (4, 1, 3, 8);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (4, 1, 4, 1);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (4, 1, 4, 2);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (4, 1, 4, 3);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (4, 1, 4, 4);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (4, 1, 4, 5);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (4, 1, 4, 6);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (4, 1, 4, 7);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (4, 1, 4, 8);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (4, 2, 1, 1);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (4, 2, 1, 2);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (4, 2, 1, 3);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (4, 2, 1, 4);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (4, 2, 1, 5);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (4, 2, 1, 8);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (4, 2, 4, 1);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (4, 2, 4, 2);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (4, 2, 4, 3);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (4, 2, 4, 4);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (4, 2, 4, 5);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (4, 2, 4, 8);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (4, 3, 1, 1);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (4, 3, 1, 2);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (5, 1, 1, 1);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (5, 1, 1, 2);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (5, 1, 1, 3);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (5, 1, 1, 4);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (5, 1, 1, 5);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (5, 1, 1, 6);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (5, 1, 1, 7);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (5, 1, 1, 8);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (5, 1, 3, 1);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (5, 1, 3, 2);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (5, 1, 3, 3);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (5, 1, 3, 4);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (5, 1, 3, 5);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (5, 1, 3, 6);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (5, 1, 3, 7);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (5, 1, 3, 8);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (5, 1, 4, 1);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (5, 1, 4, 2);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (5, 1, 4, 3);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (5, 1, 4, 4);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (5, 1, 4, 5);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (5, 1, 4, 6);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (5, 1, 4, 7);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (5, 1, 4, 8);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (5, 2, 1, 1);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (5, 2, 1, 2);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (5, 2, 1, 3);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (5, 2, 1, 4);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (5, 2, 1, 5);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (5, 2, 1, 8);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (5, 2, 3, 1);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (5, 2, 3, 2);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (5, 2, 3, 3);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (5, 2, 3, 4);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (5, 2, 3, 5);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (5, 2, 3, 8);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (5, 2, 4, 1);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (5, 2, 4, 2);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (5, 2, 4, 3);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (5, 2, 4, 4);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (5, 2, 4, 5);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (5, 2, 4, 8);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (5, 3, 1, 1);");
	xtc_db_query("INSERT INTO log_configuration (log_group_id, log_level_id, log_output_type_id, log_output_id) VALUES (5, 3, 4, 1);");
	
	@xtc_db_query("DROP TABLE IF EXISTS log_groups;");
	xtc_db_query("
		CREATE TABLE log_groups (
		  log_group_id int(11) NOT NULL AUTO_INCREMENT,
		  name varchar(255) NOT NULL,
		  PRIMARY KEY (log_group_id),
		  UNIQUE KEY name (name)
		) ENGINE=MyISAM DEFAULT CHARSET=utf8 ;
	");
	xtc_db_query("INSERT INTO log_groups (log_group_id, name) VALUES (1, 'error_handler');");
	xtc_db_query("INSERT INTO log_groups (log_group_id, name) VALUES (2, 'security');");
	xtc_db_query("INSERT INTO log_groups (log_group_id, name) VALUES (3, 'payment');");
	xtc_db_query("INSERT INTO log_groups (log_group_id, name) VALUES (4, 'shipping');");
	xtc_db_query("INSERT INTO log_groups (log_group_id, name) VALUES (5, 'widgets');");
	
	@xtc_db_query("DROP TABLE IF EXISTS log_levels;");
	xtc_db_query("
		CREATE TABLE log_levels (
		  log_level_id int(11) NOT NULL AUTO_INCREMENT,
		  name varchar(255) NOT NULL,
		  PRIMARY KEY (log_level_id),
		  UNIQUE KEY name (name)
		) ENGINE=MyISAM DEFAULT CHARSET=utf8 ;
	");
	xtc_db_query("INSERT INTO log_levels (log_level_id, name) VALUES (1, 'error');");
	xtc_db_query("INSERT INTO log_levels (log_level_id, name) VALUES (2, 'warning');");
	xtc_db_query("INSERT INTO log_levels (log_level_id, name) VALUES (3, 'notice');");
	
	@xtc_db_query("DROP TABLE IF EXISTS log_output_types;");
	xtc_db_query("
		CREATE TABLE log_output_types (
		  log_output_type_id int(11) NOT NULL AUTO_INCREMENT,
		  name varchar(255) NOT NULL,
		  PRIMARY KEY (log_output_type_id),
		  UNIQUE KEY name (name)
		) ENGINE=MyISAM DEFAULT CHARSET=utf8 ;
	");
	xtc_db_query("INSERT INTO log_output_types (log_output_type_id, name) VALUES (1, 'file');");
	xtc_db_query("INSERT INTO log_output_types (log_output_type_id, name) VALUES (2, 'screen');");
	xtc_db_query("INSERT INTO log_output_types (log_output_type_id, name) VALUES (3, 'mail');");
	xtc_db_query("INSERT INTO log_output_types (log_output_type_id, name) VALUES (4, 'html_file');");
	
	@xtc_db_query("DROP TABLE IF EXISTS log_outputs;");
	xtc_db_query("
		CREATE TABLE log_outputs (
		  log_output_id int(11) NOT NULL AUTO_INCREMENT,
		  name varchar(255) NOT NULL,
		  PRIMARY KEY (log_output_id),
		  UNIQUE KEY name (name)
		) ENGINE=MyISAM DEFAULT CHARSET=utf8 ;
	");
	xtc_db_query("INSERT INTO log_outputs (log_output_id, name) VALUES (1, 'output');");
	xtc_db_query("INSERT INTO log_outputs (log_output_id, name) VALUES (2, 'filepath');");
	xtc_db_query("INSERT INTO log_outputs (log_output_id, name) VALUES (3, 'backtrace');");
	xtc_db_query("INSERT INTO log_outputs (log_output_id, name) VALUES (4, 'request_data');");
	xtc_db_query("INSERT INTO log_outputs (log_output_id, name) VALUES (5, 'code_snippet');");
	xtc_db_query("INSERT INTO log_outputs (log_output_id, name) VALUES (6, 'class_data');");
	xtc_db_query("INSERT INTO log_outputs (log_output_id, name) VALUES (7, 'function_data');");
	xtc_db_query("INSERT INTO log_outputs (log_output_id, name) VALUES (8, 'session_data');");
	
	
	//2.5.11
	$check_query = xtc_db_query("SELECT configuration_key FROM " . TABLE_CONFIGURATION . "  WHERE configuration_key = 'PAYPAL_PAYMENT_MODE';");
	if (xtc_db_num_rows($check_query) == 0) {
		xtc_db_query("INSERT INTO configuration VALUES (NULL, 'PAYPAL_PAYMENT_MODE', 'Sale', 25, 1, NULL, NOW(), NULL, \"xtc_cfg_select_option(array('Sale', 'Authorization'),\");");
	}
	$check_query = xtc_db_query("SELECT configuration_key FROM " . TABLE_CONFIGURATION . "  WHERE configuration_key = 'DISPLAY_START_NEW_PRODUCTS';");
	if (xtc_db_num_rows($check_query) == 0) {
		xtc_db_query("INSERT INTO configuration VALUES (NULL, 'DISPLAY_START_NEW_PRODUCTS', 'top', 1000, 50, NULL, NOW(), NULL, \"xtc_cfg_select_option(array('top', 'newproducts'),\");");
	}
	if (!column_exists ('blog_items','canonical')) {
		xtc_db_query("ALTER TABLE blog_items ADD COLUMN canonical varchar(250) NOT NULL DEFAULT '';");
	}
	if (!column_exists ('blog_items','calender')) {
		@xtc_db_query("ALTER TABLE blog_items ADD COLUMN calender INT(5) NOT NULL DEFAULT '0' AFTER item_id;");
	}
	if (!column_exists ('blog_items','datestart')) {
		@xtc_db_query("ALTER TABLE blog_items ADD COLUMN datestart DATE NOT NULL AFTER date_release;");
	}
	if (!column_exists ('blog_items','dateend')) {
		@xtc_db_query("ALTER TABLE blog_items ADD COLUMN dateend DATE NOT NULL AFTER datestart;");
	}
	if (!column_exists ('blog_items','slider_set')) {
		@xtc_db_query("ALTER TABLE blog_items ADD COLUMN slider_set INT(11) NOT NULL DEFAULT '0' AFTER categories_id;");
	}
	if (!column_exists ('blog_categories','itemsort')) {
		xtc_db_query("ALTER TABLE blog_categories ADD COLUMN itemsort int(11) NOT NULL DEFAULT '1' AFTER sort_order;");
	}
	if (!column_exists ('blog_categories','itemsortart')) {
		xtc_db_query("ALTER TABLE blog_categories ADD COLUMN itemsortart int(11) NOT NULL DEFAULT '1' AFTER sort_order;");
	}
	if (!column_exists ('blog_categories','slider_set')) {
		xtc_db_query("ALTER TABLE blog_categories ADD COLUMN slider_set int(11) NOT NULL DEFAULT '0';");
	}
	if (!column_exists ('blog_categories','canonical')) {
		xtc_db_query("ALTER TABLE blog_categories ADD COLUMN canonical varchar(250) NOT NULL DEFAULT '';");
	}
	if (!column_exists ('blog_start','slider_set')) {
		xtc_db_query("ALTER TABLE blog_start ADD COLUMN slider_set int(11) NOT NULL DEFAULT '0';");
	}
	if (!column_exists ('cseo_slider_gallery','slider_mobile')) {
		xtc_db_query("ALTER TABLE cseo_slider_gallery ADD COLUMN slider_mobile int(1) NOT NULL DEFAULT '1';");
	}
	if (!column_exists ('cseo_slider_gallery','slider_nav_status')) {
		xtc_db_query("ALTER TABLE cseo_slider_gallery ADD COLUMN slider_nav_status int(1) NOT NULL DEFAULT '1';");
	}
	if (!column_exists ('cseo_slider_gallery','slider_url_6')) {
		@xtc_db_query("ALTER TABLE cseo_slider_gallery
			ADD COLUMN slider_url_6 VARCHAR(255) NOT NULL AFTER slider_url_5,
			ADD COLUMN slider_image_6 VARCHAR(255) NOT NULL AFTER slider_image_5,
			ADD COLUMN slider_link_text_6 VARCHAR(255) NOT NULL AFTER slider_link_text_5,
			ADD COLUMN slider_desc_6 TEXT NULL AFTER slider_desc_5;");
	}
	if (!column_exists ('cseo_slider_gallery','slider_url_7')) {
		@xtc_db_query("ALTER TABLE cseo_slider_gallery
			ADD COLUMN slider_url_7 VARCHAR(255) NOT NULL AFTER slider_url_6,
			ADD COLUMN slider_image_7 VARCHAR(255) NOT NULL AFTER slider_image_6,
			ADD COLUMN slider_link_text_7 VARCHAR(255) NOT NULL AFTER slider_link_text_6,
			ADD COLUMN slider_desc_7 TEXT NULL AFTER slider_desc_6;");
	}
	if (!column_exists ('cseo_slider_gallery','slider_url_8')) {
		@xtc_db_query("ALTER TABLE cseo_slider_gallery
			ADD COLUMN slider_url_8 VARCHAR(255) NOT NULL AFTER slider_url_7,
			ADD COLUMN slider_image_8 VARCHAR(255) NOT NULL AFTER slider_image_7,
			ADD COLUMN slider_link_text_8 VARCHAR(255) NOT NULL AFTER slider_link_text_7,
			ADD COLUMN slider_desc_8 TEXT NULL AFTER slider_desc_7;");
	}
	
	xtc_db_query("UPDATE admin_navigation SET title = 'magnalister' WHERE title = 'Magnalister';");
	xtc_db_query("DELETE FROM configuration WHERE configuration_key = 'AJAXJYOUTUBE';");
	xtc_db_query("UPDATE database_version SET version = 'commerce:seo v2next 2.5.13'");
	

}

function remove() {
  xtc_db_query("DELETE FROM " . TABLE_CONFIGURATION . " WHERE configuration_key in ('" . implode("', '", $this->keys()) . "')");
  xtc_db_query("DELETE FROM " . TABLE_CONFIGURATION . " WHERE configuration_key = 'MODULE_CSEO_V251QF13'");
  xtc_db_query("UPDATE database_version SET version = 'commerce:seo v2next 2.5.12'");
}

}
